package com.douqu.game.main.database.mapper.read;

import com.douqu.game.core.database.model.PlayerModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by bean on 2017/7/17.
 */
public interface ReadPlayerMapper {

    Map<String, Object> getPlayerNameAvatar(@Param("objectIndex") String objectIndex);

    List<PlayerModel> getPlayerByUid(@Param("uid") Integer uid);

    PlayerModel getPlayerByName(@Param("name") String name);

    PlayerModel findById(@Param("id") Integer id);

    PlayerModel getPlayerByIndex(@Param("objectIndex") String objectIndex);

    List<PlayerModel> getPlayerListByIndex(@Param("indexList") List<String> indexList);

    List<PlayerModel> getPlayerListByName(@Param("nameList") List<String> nameList);

    List<PlayerModel> getPlayerListByUid(@Param("uids") List<Integer> uids);

    /**
     * 查询出所有我玩家 不包括机器人
     * @return
     */
    List<PlayerModel> getAllPlayer();

    /**
     * 修复数据时用，查找所有玩家，包括机器人
     * @return
     */
    List<PlayerModel> findAll();

    int findAllCount(@Param("keyword") String keyword);

    int findRobotCount();

    List<PlayerModel> findAllRobot();

    /**
     * 根据条件查询所有玩家，不包括机器人
     * @param start
     * @param count
     * @param keyword
     * @return
     */
    List<PlayerModel> findList(@Param("start") Integer start,
                               @Param("count") Integer count,
                               @Param("keyword") String keyword);

    /**
     * 群发邮件时用，不包括机器人
     * @param camp
     * @param minLevel
     * @param maxLevel
     * @return
     */
    List<PlayerModel> findListByGroupMail(@Param("camp") Integer camp,
                                          @Param("minLevel") Integer minLevel,
                                          @Param("maxLevel") Integer maxLevel,
                                          @Param("lastLoginDays") Integer lastLoginDays);

    Integer getMinPlayerCountCamp(@Param("camp") Integer camp);

    Integer getMyFCRank(@Param("fc") Integer fc);

    List<String> getRobotPlayerByMaxCount(@Param("count") Integer count);

    List<PlayerModel> getTopPlayer(@Param("count") Integer count);
}
